import http from '@/utils/http'

/**
 * 
 * @param { Object } param { goodsId, count, blessing:祝福语 }
 * @returns Promise
 */
export const reqAddCart = ({goodsId, count, ...data}) =>{
  return http.get(`/cart/addToCart/${goodsId}/${count}`, data)
}
/**
 * @returns Promise
 */
export const reqCartList = () => {
  return http.get('/cart/getCartList')
}

/**
 * 
 * @param {*} goodsId 商品ID
 * @param {*} isChecked 0 说明需要取消勾选，1 需要勾选
 */
export const reqUpdateChecked = (goodsId, isChecked) => {
  return http.get(`/cart/checkCart/${goodsId}/${isChecked}`)
}

/**
 * 
 * @param {*} isChecked 0 代表取消全选，1 代表进行全选
 */
export const reqCheckAllStatus = (isChecked) => {
  return http.get(`/cart/checkAllCart/${isChecked}`)
}

/**
 * 
 * @param {*} goodsId 商品ID
 */
export const reqDelCartGoods = (goodsId) => {
  return http.get(`/cart/delete/${goodsId}`)
}